import ui.Gui;
import storage.TaskList;
import timer.Reminder;
import ui.CmdLineUI;
import sharedUtils.Constants;

public class QuickTODO {
	/**
	 * Start of main responsibilities
	 * 
	 * Create task list object. For now, use the default constructor, 
	 * don't use the one which asks for fileLocation (see TaskList.java constructor)
	 * Create UI object
	 * Call UI to run, passing it this newly created task list object
	 * ad
	 * End of main.java responsibility
	 * 
	 * Start of UI responsibilities
	 * 
	 * UI will then take user input and pass to InputDecoder to decode
	 * InputDecoder will return a DisplayPackage object.
	 * Access it to determine the code and based on what to show to the user.
	 * 
	 * End of UI responsibilities
	 */	
	
	//@author A0097758E
	public static void main(String[] args) {
		TaskList taskList = new TaskList(Constants.DEFAULT_FILE_LOC);
		
		startCLUI(taskList);
		startReminders(taskList);
		startGUI(taskList);
	}

	private static void startCLUI(TaskList taskList) {
		if(!Constants.isClUiEnabled) {
			return;
		}
		
		CmdLineUI clui = new CmdLineUI(taskList);
				
		Thread threadUI = new Thread(clui);
		threadUI.start();
	}

	private static void startReminders(TaskList taskList) {
		if(!Constants.areRemindersEnabled) {
			return;
		}
		
		Reminder remind = new Reminder(taskList);
		
		Thread threadRemind = new Thread(remind);
		threadRemind.start();
	}

	private static void startGUI(TaskList taskList) {
		if(!Constants.isGuiEnabled) {
			return;
		}
		
		Gui gui = new Gui(taskList);
		
		Thread threadGUI = new Thread(gui);
		threadGUI.start();
	}
}